using Godot;
using System;
[GlobalClass]


public partial class TalkTask : Tasks
{
	public MessageManager messageManager;
	public TaskManager taskManager;
	// Called when the node enters the scene tree for the first time.
	public override void _Ready()
	{
		this.CurrentType = Type.TALK;
		var Game = GetNode<Game>("/root/Game");
		messageManager = Game.get_message_manager();
		taskManager = Game.get_player().GetNode<TaskManager>("%TaskManager") as TaskManager;
		messageManager.DialogStart += TaskComplete;
	}

	// Called every frame. 'delta' is the elapsed time since the previous frame.
	public override void _Process(double delta)
	{
	}
	public void TaskComplete(Characters character)
	{
		GD.Print("和", character.Name,"对话");
		if(character.CharacterData.name == target)
		{
			ChildTaskComplete(this);
		}
	}
}
